<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Static Grid</title>

  <link rel="stylesheet" href="demo.css"/>
  <script src="../dist/gridstack-all.js"></script>

</head>
<body>
  <div class="container-fluid">
    <h1>Static vs can move/drag Demo</h1>
    <p>we start with a static grid (no drag&drop initialized) with button to make it editable.</p>

    <div class="sidebar" style="height:50px">
      <div class="grid-stack-item">
        <div class="grid-stack-item-content">Drag me</div>
      </div>
      <div class="grid-stack-item" gs-w="2" gs-h="1" gs-max-w="3">
        <div class="grid-stack-item-content">2x1, max=3</div>
      </div>
    </div>
    <div>
      <a class="btn btn-primary" onClick="grid.setStatic(true)" href="#">Static</a>
      <a class="btn btn-primary" onclick="grid.setStatic(false)" id="float" href="#">Editable</a>
    </div>
    <div class="grid-stack"></div>
  </div>
  <script src="events.js"></script>
  <script type="text/javascript">
    let grid = GridStack.init({
      float: true,
      cellHeight: 70,
      acceptWidgets: true,
      removable: true,
      staticGrid: true
    });
    addEvents(grid);

    let serializedData = [
      {x: 0, y: 0, w: 2, h: 2, id: '0'},
      {x: 3, y: 1, h: 2, id: 'no_move', noMove: true, content: 'no move'},
      {x: 4, y: 1, id: '2'},
      {x: 2, y: 3, w: 3, id: 'no_resize', noResize: true, content: 'no resize'},
      {x: 1, y: 3, id: 'locked', locked: true, content: 'locked'}
    ];
    grid.load(serializedData);

    GridStack.setupDragIn('.sidebar>.grid-stack-item');

    // grid.setStatic(false); // TEST enable after disabled

  </script>
</body>
</html>
